//
//  JZSearchCollectionViewCell.m
//  TuDianEducation
//
//  Created by lixinkeji on 2020/9/1.
//  Copyright © 2020 zhangbenchao. All rights reserved.
//

#import "JZSearchCollectionViewCell.h"
#import "LXSaveUserInforTool.h"
@interface JZSearchCollectionViewCell()

@end
@implementation JZSearchCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self viewConfig];
    }
    return self;
}
-(void)viewConfig{
    [self.contentView addSubview:self.messageLabel];
}
-(UILabel *)messageLabel{
    if (!_messageLabel) {
        _messageLabel = [TSWLTools allocLabel:@"保姆" font:systemFont(TSScaleW(12)) textColor:kGrayTxtColor frame:CGRectMake(0, 0, self.width, self.height) textAlignment:(NSTextAlignmentCenter)];
        _messageLabel.backgroundColor = kGrayBtnBacColor;
        [_messageLabel setCornerRadius:_messageLabel.height/2.f];
        
    }
    return _messageLabel;
}
-(void)setIsSelct:(BOOL)isSelct{
    _isSelct = isSelct;
    UIColor *selectColor = kWhiteColor;
    UIColor *backColor = kBlueColor;
    if ([LXSaveUserInforTool sharedUserTool].type == 2) {
        selectColor = kBlueColor;
        backColor = kGrayBtnBacColor;
    }
    if ([LXSaveUserInforTool sharedUserTool].type == 1) {
        selectColor = kWhiteColor;
        backColor = kBlueColor;
    }
    if (_isSelct) {
        _messageLabel.textColor = selectColor;
        _messageLabel.backgroundColor = backColor;
    }else{
        _messageLabel.textColor = kMainTxtColor;
        _messageLabel.backgroundColor = kGrayBtnBacColor;
    }
}
@end
